using System;
using System.Text;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using OVS.BusinessObjects;
using OVS.DAL;

namespace OVS.BLL
{
	public partial class ConfigBLL
	{
		private ConfigDAO _ConfigDAO;

		public ConfigDAO ConfigDAO
		{
			get { return _ConfigDAO; }
			set { _ConfigDAO = value; }
		}

		public ConfigBLL()
		{
			ConfigDAO = new ConfigDAO();
		}
		public List<Config> GetConfigs()
		{
			try
			{
				return ConfigDAO.GetConfigs();
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public Config GetConfig(int conf_id)
		{
			try
			{
				return ConfigDAO.GetConfig(conf_id);
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public int AddConfig(Config oConfig)
		{
			try
			{
				return ConfigDAO.AddConfig(oConfig);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateConfig(Config oConfig)
		{
			try
			{
				return ConfigDAO.UpdateConfig(oConfig);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveConfig(Config oConfig)
		{
			try
			{
				return ConfigDAO.RemoveConfig(oConfig);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveConfig(int conf_id)
		{
			try
			{
				return ConfigDAO.RemoveConfig(conf_id);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public List<Config> DeserializeConfigs(string Path)
		{
			try
			{
				return GenericXmlSerializer<List<Config>>.Deserialize(Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public void SerializeConfigs(string Path, List<Config> Configs)
		{
			try
			{
				GenericXmlSerializer<List<Config>>.Serialize(Configs, Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
	}
}
